home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
SNDLIST-
/
INIT.C
< prev
next >
Wrap
Text File
|
1988-11-10
|
1KB
|
54 lines
/*
Sound lister
"Init.c"
*/
#include <MenuMgr.h>
#include "SndList.h"
#define sysEnvironsVersion 1
#define TN_WaitNextEvent 0x60
#define TN_Unimplemented 0x9F
#define TN_SndPlay 0x5
Boolean TrapAvailable (tNumber, tType)
register short tNumber;
register short tType;
{
return NGetTrapAddress(tNumber, tType) !=
GetTrapAddress(TN_Unimplemented);
}
void Initialize()
{
register int i;
pascal void Crash();
for (i = 0; i < 5; i++)
MoreMasters();
InitGraf(&thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(Crash);
InitCursor();
Bounds = screenBits.bounds;
InsetRect(&Bounds, 4, 4);
SysEnvirons(sysEnvironsVersion, &gMac);
if (gMac.machineType < 0 || !TrapAvailable(TN_SndPlay, ToolTrap)) {
Bounds.top += 20;
Message(mOld, 0);
ExitToShell();
}
Bounds.top += MBarHeight;
gHasWaitNextEvent = TrapAvailable(TN_WaitNextEvent, ToolTrap);
SetMenuBar(GetNewMBar(rMenuBar));
AddResMenu(GetMHandle(mApple), 'DRVR');
DrawMenuBar();
gInBackground = FALSE;
gNumDocuments = 0;
Play(HiSnd);
}